package com.fingard.dsp.bank.directbank.zmh01;

import com.fingard.dsp.bank.directbank.DirectBase;
import com.fingard.net.WebRequest;

public class ZMH01Base extends DirectBase {
    public String getCharset() {
        return getBankConfig().getCharset("UTF-8");
    }

    protected String[] sendToBank(String reqData, String serverUrl) throws Exception {
        String[] tmpRetStr = new String[]{"", ""};
        WriteBankLogStep2(reqData);
        WriteBankUrlLogLn(serverUrl);
        WebRequest tmpRequest = new WebRequest(serverUrl);
        tmpRequest.setConnectTimeout(100000);
        if (reqData == null) {
            tmpRetStr = tmpRequest.upload(null, getCharset());
        } else {
            tmpRetStr = tmpRequest.upload(reqData.getBytes(getCharset()), getCharset());
        }
        WriteBankLogStep3(tmpRetStr[1]);
        return tmpRetStr;
    }
}